package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)" json:"username"`
	Password string `gorm:"type:varchar(255)" json:"password"`
}

type Movies struct {
	gorm.Model
	Title     string `gorm:"type:varchar(30)" json:"title"`
	Content   string `gorm:"type:varchar(30)" json:"content"`
	Img       string `gorm:"type:varchar(255)" json:"img"`
	UserID    int    `gorm:"type:int" json:"user_id"`
	User      User   `gorm:"foreignKey:UserID" json:"user"`
	LikeCount int    `gorm:"type:int" json:"like_count"`
	GunCount  int    `gorm:"type:int" json:"gun_count"`
}
type Like struct {
	gorm.Model
	UserID   int    `gorm:"type:int" json:"user_id"`
	User     User   `gorm:"foreignKey:UserID" json:"user"`
	MoviesID int    `gorm:"type:int" json:"movies_id"`
	Movies   Movies `gorm:"foreignKey:MoviesID" json:"movies"`
}

type Gun struct {
	gorm.Model
	UserID   int    `gorm:"type:int" json:"user_id"`
	User     User   `gorm:"foreignKey:UserID" json:"user"`
	MoviesID int    `gorm:"type:int" json:"movies_id"`
	Movies   Movies `gorm:"foreignKey:MoviesID" json:"movies"`
}
